﻿# 依赖vtkm
cmake_minimum_required(VERSION 3.8)
project(core)

#find_package(ParaView REQUIRED)
#find_package(VTK COMPONENTS
#IOIOSS
#FiltersGeneral
#AcceleratorsVTKmDataModel
#REQUIRED)



set(headers
)

set(template_sources
)

set(host_src
#main.cpp
parser/Configuration.cpp

application/Application.cpp
application/ReMeshApp.cpp
application/Register.cpp

action/Action.cpp
action/CreateMeshAction.cpp
action/CreateSystemAction.cpp
action/AddBCAction.cpp
action/CreateExecutioner.cpp
action/AddOutput.cpp
action/AddUserObject.cpp
action/SetupDeviceAction.cpp

executioner/Executioner.cpp
executioner/Transient.cpp
executioner/Steady.cpp

meshmodifier/MeshModifier.cpp
#meshmodifier/Transform.cpp
#meshmodifier/BoundingBoxSubBlock.cpp

mesh/Mesh.cpp
mesh/BoundaryInfo.cpp
mesh/FileMesh.cpp
mesh/GeneratedMesh.cpp
mesh/UnstructuredMesh.cpp
mesh/OverlapMesh.cpp

output/Output.cpp
output/FileOutput.cpp
output/VTKOutput.cpp
#output/MultiVTKOutput.cpp

userobject/UserObject.cpp
#userobject/RemapUserObject.cpp

system/System.cpp

)
set(device_src
application/ExampleApplication.cpp
mesh/MeshTool.cpp
system/worklet/EquationSet.cpp
system/worklet/Context.cpp
system/worklet/ComputeResidual.cpp
system/worklet/InitialCondition.cpp
system/worklet/MeshModifier.cpp
system/HeatConductionSystem.cpp
system/EulerEquation.cpp
system/IsoVortex.cpp
system/ForwardStep.cpp
system/PassFlow.cpp

system/CalculateArea.cpp

#system/MultiSystem.cpp
#system/CoutteFlow.cpp
##system/Riemann2D.cpp
#system/DoubleMachReflection.cpp
#
#system/NavierStokesEquation.cpp
#system/Plate2D.cpp
#system/CavityDriven.cpp
#system/SGHSystem.cpp
#system/SodSystem.cpp
#system/TaylorGreenVortex.cpp
#system/OrszagTangVortex.cpp

)



# 头文件引入
add_library(_galois_include INTERFACE)
target_include_directories(_galois_include INTERFACE
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/action
  ${CMAKE_CURRENT_SOURCE_DIR}/application
  ${CMAKE_CURRENT_SOURCE_DIR}/executioner
  ${CMAKE_CURRENT_SOURCE_DIR}/mesh
  ${CMAKE_CURRENT_SOURCE_DIR}/meshmodifier
  ${CMAKE_CURRENT_SOURCE_DIR}/output
  ${CMAKE_CURRENT_SOURCE_DIR}/parser
  ${CMAKE_CURRENT_SOURCE_DIR}/system
  ${CMAKE_CURRENT_SOURCE_DIR}/userobject
  )

# 定义target
#add_executable(${target} ${host_src} ${device_src})
add_library(${target} ${host_src} ${device_src})

target_link_libraries(${target} PUBLIC _galois_include )

#加载 VTK-m 
target_link_libraries(${target} PUBLIC vtkm::filter vtkm::cont vtkm::worklet vtkm::io)
target_link_libraries(${target} PUBLIC ${VTK_LIBRARIES})
target_link_libraries(${target} 
PUBLIC fmt::fmt
PUBLIC trestle
)

vtkm_add_target_information(${target} DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS DEVICE_SOURCES ${device_src})


add_executable(test_main test.cpp)
target_link_libraries(test_main PRIVATE ${target})

